# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=binnavi
pkgver=6.1.0
pkgrel=3
pkgdesc='A binary analysis IDE that allows to inspect, navigate, edit and annotate control flow graphs and call graphs of disassembled code.'
groups=('blackarch' 'blackarch-disassembler' 'blackarch-reversing'
        'blackarch-binary')
arch=('any')
url='https://github.com/google/binnavi'
license=('Apache')
depends=('java-environment' 'postgresql')
source=("https://github.com/google/binnavi/releases/download/v$pkgver/$pkgname-all.jar")
noextract=('binnavi-all.jar')
sha512sums=('2b14f2dc67839a208d335281ebf1b610b5b99706985871c9816cb2a69a3eb1801891600758f159adcb6b4eed3e38188f1a3d98fe1209eeab57d4c201197560b2')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm644 binnavi-all.jar \
    "$pkgdir/usr/share/$pkgname/$pkgname-all.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-all.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

